// adjust time speed
$rotate-minute: 3600s;
$clock-size: scale(1.4);
$red: #ff3737;
$orange: #f5fc97c9;
$green: #9de16f;
$clock-base-color: #eee;
$clock-hand-color: #555;
$clock-hand-shadow-color: #555;
$clock-center-color: #ddd;
$click-indicator-color: #aaa;

// do math on padding/border/margin is not interesting: http://zh.learnlayout.com/box-sizing.html
* {
  box-sizing: border-box;
}

html,
body {
  height: 100vh;
  overflow: hidden;
  font-family: system-ui;
  margin: 0;
  padding: 0;
  position: relative;
}


.tomato-around-clock {
  position: absolute;
  z-index: 6;
  margin: 113px 114px;
  display: block;

  &:hover {
    cursor: pointer;
  }
}

.invisible {
  display: none;
}

.displayNone {
  display: none;
}

.highlighted-tomato {
  opacity: 0.35;
}

.clock-wrapper {
  z-index: 1;
  position: absolute;
  top: 35%;
  bottom: 50%;
  right: 0;
  left: 155px; // 355 - (250 / 2)
  width: 260px;
  height: 260px;
  margin: auto;
  padding: 5px;
  border-radius: 50%;
  transform: $clock-size;
  transform-origin: center;
  transition: 0.3s;

  &.clock-pushed {
    left: 310px; // 505 - (250 / 2)
  }

  .clock-base {
    width: 250px;
    height: 250px;
    background-color: $clock-base-color;
    border-radius: 50%;

    .click-indicator {
      position: absolute;
      z-index: 1;
      top: 15px;
      left: 15px;
      width: 230px;
      height: 230px;

      div {
        position: absolute;
        width: 2px;
        height: 7px;
        margin: 113px 114px;
        background-color: $click-indicator-color;
      }

      @for $i from 1 through 12 {
        div:nth-child(#{$i}) {
          transform: rotate(30deg * $i) translateY(-110px);
        }
      }
    }

    .clock-hour {
      position: absolute;
      z-index: 2;
      top: 80px;
      left: 128px;
      width: 4px;
      height: 65px;
      background-color: $clock-hand-color;
      border-radius: 2px;
      box-shadow: 0 0 2px $clock-hand-shadow-color;
      transform-origin: 2px 50px;
      transition: 0.3s;
      animation: rotate-hour 43200s linear infinite;
    }

    .clock-minute {
      position: absolute;
      z-index: 3;
      top: 60px;
      left: 128px;
      width: 4px;
      height: 85px;
      background-color: $clock-hand-color;
      border-radius: 2px;
      box-shadow: 0 0 2px $clock-hand-shadow-color;
      transform-origin: 2px 70px;
      transition: 0.3s;
      animation: rotate-minute $rotate-minute linear infinite;
    }

    .clock-minute:after {
      content: '';
      display: block;
      position: absolute;
      left: -4px;
      bottom: 9px;
      width: 8px;
      height: 8px;
      background-color: $clock-hand-color;
      border: solid 2px $clock-hand-color;
      border-radius: 50%;
      box-shadow: 0 0 3px $clock-hand-shadow-color;
    }

    .clock-center {
      position: absolute;
      z-index: 1;
      width: 150px;
      height: 150px;
      top: 55px;
      left: 55px;
      border-radius: 50%;
    }

    .clock-center:after {
      content: "";
      display: block;
      width: 20px;
      height: 20px;
      margin: 65px;
      background-color: $clock-center-color;
      border-radius: 50%;
    }

    .work-half {
      position: absolute;
      z-index: 1;
      border: 7px solid $red;
      border-radius: 50%;
      height: 250;
      width: 250;
      border-top-color: transparent;
      border-left-color: transparent;
    }

    .invisible-half {
      position: absolute;
      z-index: 4;
      border: 7px solid $clock-base-color;
      border-radius: 50%;
      height: 250;
      width: 250;
      border-top-color: transparent;
      border-left-color: transparent;
    }

    .rest-half {
      position: absolute;
      z-index: 2;
      border: 7px solid $green;
      border-radius: 50%;
      height: 250;
      width: 250;
      border-top-color: transparent;
      border-left-color: transparent;
    }

    .done-half {
      position: absolute;
      z-index: 3;
      border: 7px solid $orange;
      border-radius: 50%;
      height: 250;
      width: 250;
      border-top-color: transparent;
      border-left-color: transparent;
      transition: 0.3s;
      animation: rotate-done-minute $rotate-minute linear infinite;
    }
  }
}
